/**
 * Created by Administrator on 2017/3/15 0015.
 */
!function (global) {
    function loading() {
        var demo = document.createElement('div');
        var div1 = document.createElement('div');
        var div2 = document.createElement('div');
        var style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML="@keyframes bounce {0%, 100% {transform: scale(0.0);}50%{transform: scale(1.0);}}";
        document.head.appendChild(style);
        var divArr = [div1,div2];
        for (var i = 0;i < 2;i++){
            divArr[i].style.width = "60px";
            divArr[i].style.height  = "60px";
            divArr[i].style.backgroundColor = "#67CF22";
            divArr[i].style.borderRadius = "50%";
            divArr[i].style.opacity = ".6";
            divArr[i].style.position = "absolute";
            divArr[i].style.animation = "bounce 2.0s infinite ease-in-out";
        }
        demo.style.width = "60px";
        demo.style.height = "60px";
        demo.style.top = '0';
        demo.style.left = '0';
        demo.style.bottom = '0';
        demo.style.right = '0';
        demo.style.margin = "auto";
        demo.style.position = "absolute";
        divArr[1].style.animationDelay = "-1.0s";
        demo.appendChild(div1);
        demo.appendChild(div2);
        document.body.appendChild(demo);
    }
    // global.loading = loading;
    loading();
}(window);